<template >
  <div>
    <el-menu class="menu" mode="horizontal"
    :default-active="$route.path">
      <el-menu-item
        v-for="item in menuList"
        :key="item.path"
        :index="item.path"
        @click="$router.replace(item.path)">{{item.label}}</el-menu-item>
    </el-menu>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data () {
    return {
      menuList: [
        {
          label: '采购数据统计',
          path: '/admin/purchase/statistics',
        },
        {
          label: '线下采购列表',
          path: '/admin/purchase/offline',
        },
        {
          label: '线上采购列表',
          path: '/admin/purchase/online',
        },
        {
          label: '供应商登记列表',
          path: '/admin/purchase/supplier',
        },
        {
          label: '采购商品管理',
          path: '/admin/purchase/goods',
        },
      ],
    };
  },
};
</script>

<style scoped>
.menu {
  margin-bottom: 12px;
}
</style>
